package com.jic.market.api.rest;

import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.market.request.rest.coupon.*;
import com.jic.market.response.rest.coupon.QueryCouponPersonResponse;
import com.jic.market.response.rest.coupon.QueryCouponCenterResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/**
 * @author: wwb
 * @date: 2020-01-17
 * @remark: 优惠券业务api
 */

@FeignClient(name = "jic-market",path = "/rest/coupon")
public interface CouponRestApi {

    @PostMapping("/query-coupon-goodsId")
    RestResult<PageResult<QueryCouponCenterResponse>> queryCouponByThirdProductCode(@Valid @RequestBody CouponListOfGoodsRequest couponListOfGoodsRequest);

    @PostMapping("/receive-coupon-person")
    RestResult<Boolean> receiveCoupon(@Valid @RequestBody CouponReceiveOfPersonRequest couponReceiveOfPersonRequest);

    @PostMapping("/query-coupon-center")
    RestResult<PageResult<QueryCouponCenterResponse>> queryCouponCenter(@Valid @RequestBody QuyerCouponCenterRequest quyerCouponCenterRequest);

    @PostMapping("/query-coupon-info")
    RestResult<QueryCouponCenterResponse> queryCouponInfo(@Valid @RequestBody QuyerCouponCenterRequest quyerCouponCenterRequest);

    @PostMapping("/query-coupon-person")
    RestResult<PageResult<QueryCouponPersonResponse>> couponListOfPerson(@Valid @RequestBody QueryCouponPersonRequest queryCouponPersonRequest);

    @PostMapping("/settlement-coupon-list")
    RestResult<List<QueryCouponPersonResponse>> settlementMyCouponList(@Valid @RequestBody SettlementMyCouponRequest settlementMyCouponRequest);

    @PostMapping("/use-coupon")
    RestResult<Boolean> useCoupons(@RequestBody UseCouponRequest useCouponRequest);

    @PostMapping("/return-coupon")
    RestResult<Boolean> returnCoupon(@RequestBody ReturnCouponRequest returnCouponRequest);


    @PostMapping("/getPhoneCouponCenter")
    RestResult<PageResult<QueryCouponCenterResponse>> getPhoneCouponCenter(@Valid @RequestBody QuyerCouponCenterRequest quyerCouponCenterRequest);

}
